@import "variables";
@import "fonts";

@media (min-width: 0px) {
    body {
        @include font-regular();

        padding: 0;
        margin: 0;

        color: $text-color;

        .container {
            font-size: 16px;
            line-height: 30px;
        }
    }

    h1 {
        @include font-bold();
        font-size: 18px;
    }

    h2 {
        @include font-bold();
        font-size: 16px;
    }

    a {
        color: $text-color;
        text-decoration: none;
    }

    pre {
        font-size: 12px;
        line-height:1.5em;
        font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    }

    code {
        overflow: scroll
    }

    .content-width {
        margin: auto;
        width: 100%;
    }

    .centered {
        text-align: center;
    }

    header {
        width: 100%;

        background-image: url(/images/common/BANNER_STRIPS1_Orange.png);
        background-position: center;
        color: $header-text-color;

        a {
            color: rgba(255, 255, 255, 0.75);
            &:hover {
                color: rgba(255, 255, 255, 1);
                text-decoration: none;
            }
        }

        .header-title {
            display: inline-block;

            img {
                padding: 24px 0px;
                padding-right: 8px;
                vertical-align: middle;
            }

            h1 {
                @include font-regular();
                font-size: 22px;
                display: inline;
                vertical-align: middle;
            }
        }

        nav {
            @include font-regular();
            margin: auto;
            font-size: 16px;
        }

        ul {
            float: right;
            list-style-type: none;
            margin: 22px 0px;
            padding: 0;

            li {
                display: inline;
                padding: 10px 0px;
                margin: auto 30px;
            }

            li.active {
                border-bottom: 2px solid $header-text-highlight;
                a {
                    color: rgba(255, 255, 255, 1);
                }
            }
        }

        .header-mobile-icon {
            display: none;
        }

        .header-content {
            clear: both;
            margin: auto;
            padding: 20px 0px;

            h1 {
                color: $header-title-color;
                font-size: 24px;
            }

            img {
                padding: 30px;
                margin: auto;
            }

            p {
                font-size: 14px;
                margin: 0;
                padding: 0;
            }

            .font-icon {
                @include font-smoothing(on);
                font-size: 50px;
                font-weight: normal;
                vertical-align: text-top;
                line-height: 18px;
                margin-right: 10px;
            }
        }

        .header-page {
            h1 {
                display: inline-block;
            }

            .search {
                float: right;
                margin: 0;
                margin-top: 10px;
            }
        }

        .header-front-page {
            text-align: center;
        }
    }

    footer {
        height: 100px;
        width: 100%;
        clear: both;

        ul {
            margin: auto;
            padding: 0px;
            padding-top: 16px;
            line-height: 32px;

            border-top: 1px solid $footer-border-color;

            list-style-type: none;

            li {
                float: left;
                a {
                    padding: 8px 16px;
                    color: $footer-text-color;

                    &.inactive {
                        opacity: 0.5;
                    }
                }

                &.flags {
                    padding-left: 0px;
                    margin-right: 16px;

                    a {
                        padding-left: 0px;
                        padding-right: 0px;
                    }

                    img {
                        height: 14px;
                    }
                }
            }
        }
    }

    .localization-note {
        clear:both;
        margin-top: 25px;
        text-align: center;
    }

    .search-icon:before {
        font-size: 26px;
        position: relative;
        right: 70px;
        top: 3px;
        content: "\E333";
    }

    .alert-info {
        border: 1px solid $alert-border-color;
        background-color: $alert-background-color;
        color: $alert-text-color;
        padding: 14px;
        font-size: 14px;
        line-height: 24px;
    }

    input.search {
        height: 24px;
        width: 30%;
        margin: 25px;
        padding: 5px 20px;
        background-color: rgba(0, 0, 0, 0);
        border: 2px solid rgba(255, 255, 255, 0.5);

        color: $header-text-color;
        font-size: 14px;

        &::-webkit-input-placeholder {
            color: rgba(255, 255, 255, 0.7);
        }
        &::-moz-input-placeholder {
            color: rgba(255, 255, 255, 0.7);
        }
        &::-ms-input-placeholder {
            color: rgba(255, 255, 255, 0.7);
        }
        &::input-placeholder {
            color: rgba(255, 255, 255, 0.7);
        }

        &:focus {
            outline: 0;
            border-color: rgba(255,255,255,1);
        }
    }

    nav.regular {
        background-color: $navbar-background-color;
        border-top: 1px solid $navbar-background-color;
        border-bottom: 1px solid $navbar-border-color;
        font-size: 14px;

        ul {
            $nav-height: 52px;

            list-style-type: none;
            margin: 0 auto;
            padding: 0;
            height: $nav-height;

            > li {
                float: left;
                border-left: 1px solid $navbar-border-color;

                &:last-child {
                    border-right: 1px solid $navbar-border-color;
                }

                &.active {
                    background-color: $navbar-active-background-color;
                    border-bottom: 1px solid $navbar-active-background-color;

                    > a {
                        color: $navbar-active-text-color;
                    }
                }

                > a {
                    display: block;
                    color: $navbar-text-color;
                    height: $nav-height;
                    line-height: $nav-height;
                    padding: 0 36px;
                }
            }
        }

        usermanual-navbar {
            float: right;
        }
    }


    nav.intro {
        background-color: $navbar-background-color;
        border-top: 1px solid $navbar-background-color;
        border-bottom: 1px solid $navbar-border-color;
        font-size: 14px;

        ul {
            $nav-height: 170px;
            list-style-type: none;
            margin: 0 auto;
            height: $nav-height;
            padding: 0;
            width: 100%;

            > li {
                float: left;
                width: calc(25% - 4px);
                padding: 0;
                vertical-align: middle;
                text-align: center;
                border-left: 1px solid $navbar-border-color;

                > a {
                    display: block;
                    color: $navbar-text-color;
                    height: $nav-height;
                    padding: 0 0px;


                    &:hover > span {
                        color: $playcanvas-orange;
                    }

                    > span {
                        display: block;
                        padding-top: 30px;

                    }

                    > p {
                        margin: 0;
                    }
                }

                // &:last-child {
                //     border-right: 1px solid $navbar-border-color;
                // }
            }

        }

        span {
            font-size: 64px;
        }

        .video-icon:after {
            content: "\E275";
            @include font-icon();
        }

        .forum-icon:after {
            content: "\E477";
            @include font-icon();
        }

        .manual-icon:after {
            content: "\E222";
            @include font-icon();
        }

        .tutorials-icon:after {
            content: "\E212";
            @include font-icon();
        }

        .api-icon:after {
            content: "\E353";
            @include font-icon();
        }
    }

    .container {
        nav {
            line-height: 24px;
        }

        nav.tutorial {
            float: left;
            width: 100%;
            padding: 27px 0px;
            font-size: 16px;
            color: $sidebar-text-color;

            ul {
                list-style-type: none;
                margin: 0;
                padding: 0;

                .tutorial-filter {
                    padding: 4px;
                }

                a {
                    color: $sidebar-text-color;
                }

                .tutorial-filter-text {
                    font-size: 18px;
                    padding: 16px 8px;

                    &:hover {
                        cursor: pointer;
                        text-decoration: underline;
                    }
                }

                .tutorial-checkbox {
                    font-size: 20px;
                    &.on:before {
                        content: "\E379";
                        @include pc-icon();
                    }
                    &:before {
                        content: "\E377";
                        @include pc-icon();
                    }
                }

                .tutorial-checkbox:hover {
                    &:before {
                        cursor: pointer;
                        content: "\E379";
                        @include pc-icon();
                    }
                }
            }
        }

        nav.usermanual {
            float: left;
            width: 100%;
            padding: 27px 0px;
            font-size: 16px;

            ul {
                list-style-type: none;
                margin: 0;
                padding: 0;
                margin-top: 3px;

                .expander {
                    float: left;
                    margin-left: -24px;

                    &.hidden {
                        display: none;
                    }

                    &.open {
                        margin-top: -2px;
                        .expander-icon {
                            transform: rotate(90deg);
                            display: block;

                            > a {
                                color: $playcanvas-orange;
                            }
                        }
                    }

                    &.closed {
                        .expander-icon {
                            transform: rotate(0deg);
                            display: block;
                        }
                    }

                }

                li {
                    padding: 5px 0px;

                    &.parent {
                        &:before {
                            content: "\E113";
                            @include font-icon();
                        }
                    }

                    &.closed > ul {
                        display: none;
                    }

                    &.open > ul {
                        display: block;
                    }

                    & li {
                        padding: 5px 15px;
                    }

                    > a {
                        color: $sidebar-text-color;

                        &.current {
                            color: $playcanvas-orange;
                        }
                    }

                }


            }

        }

        main {
            float: left;
            width: 640px;
            padding: 20px 0px;
            padding-left: 30px;
            color: $main-text-color;

            > h1:first-child {
                margin-top: 0.5em;
            }

            h1, h2, h3, h4, h5 {
                margin-top: 1.5em;
                margin-bottom: 0.5em;
            }

            h1 {
                @include font-bold();
                font-size: 28px;
            }
            h2 {
                @include font-bold();
                font-size: 24px;
            }
            h3 {
                @include font-bold();
                font-size: 20px;
            }
            h4 {
                @include font-bold();
                font-size: 18px;
            }
            h5 {
                @include font-bold();
                font-size: 16px;
            }

            p {
                margin-top: 0.2em;
            }

            a {
                color: $main-link-color;

                &:hover {
                    text-decoration: underline;
                }
            }

            img {
                display: block;
                margin: 0 auto;
                max-width: 800px;
            }

            table {
                border-collapse: collapse;
                width: 100%;

                margin: 20px 0px;

                th {
                    @include font-bold();
                    border-top: 1px solid $table-border-color;
                    border-bottom: 1px solid $table-border-color;
                    padding: 5px;
                    font-size: 14px;
                    text-align: left;
                }

                td {
                    border-top: 1px solid $table-border-color;
                    border-bottom: 1px solid $table-border-color;
                    padding: 5px;
                    font-size: 14px;
                }

                &.head-column {
                    td:first-child {
                        width: 60%;
                    }
                    td:last-child {
                        @include font-bold();
                        font-size: 14px;
                    }
                }
                &.three-column {
                    td:first-child {
                        @include font-bold();
                        width: 30%;
                    }
                    td:last-child {
                        @include font-bold();
                        font-size: 14px;
                    }
                }

                &.centered {
                    text-align: center;
                }
            }

            iframe {
                width: 100%;
                height: 480px;
                max-width: 100%;
                border: none;
            }

            &.full-width {
                width: 100%;
                padding: 0;
            }

            &.frontpage {
                float: none;
                padding: 0px;
                width: 100%;
            }

            hr {
                border: 1px solid $hr-color;
                margin-top: 20px;
                margin-bottom: 20px;
            }

            .thumbnail {
                float: left;
                overflow: hidden;
                width: 33%;
                text-align: center;
                padding-top: 30px;

                h1 {
                    padding: 0;
                    margin: 0;
                }

                p {
                    padding: 0;
                    margin: 0;
                    font-size: 12px;
                    color: $light-text-color;
                }
            }

            .tutorial-cloud {
                width: 100%;
                a {
                    float: left;
                    text-align: center;
                    background-color: #f1f1ef;
                    font-size: 16px;
                    padding: 0px 16px;
                    margin: 5px;
                    color: #5b7073;
                    width: 150px;
                    height: 225px;
                    line-height: 18px;

                    &:hover {
                        color: $main-link-color;
                        background-color: lighten($navbar-background-color, 5%);
                        text-decoration: none;
                    }

                    .thumb {
                        width: 150px;
                        height: 150px;
                        margin: auto;
                        padding-top: 16px;
                        padding-bottom: 12px;
                        vertical-align: middle;
                    }
                }
            }

            a.tutorial-button {
                font-size: 18px;
                padding: 4px 12px 4px 0px;
                color: $navbar-text-color;
                background-color: $navbar-background-color;
                border: 1px solid $navbar-text-color;
                display: block;
                width: 120px;
                float: left;
                margin-right: 10px;
                &:hover {
                    text-decoration: none;
                }
            }

            a.project-button {
               &:before {
                    content: "\E226";
                    @include font-icon();
                    padding: 0px 8px 0px 10px;
                }
            }

            a.editor-button {
                &:before {
                    content: "\E367";
                    @include font-icon();
                    padding: 0px 8px 0px 10px;
                }
            }

            .hidden {
                display: none;
            }

            .alert {
                clear: both;
                margin-bottom: 25px;
                text-align: center;
            }
        }

        // .thumbnail {
        //     float: left;
        //     img {
        //         width: 33%;
        //         margin: 0;
        //         padding: 0;
        //     }

        //     p {
        //         margin: 0;
        //         padding: 0;
        //     }
        // }
    }

    .search-container {
        > main {
            @include font-regular();
            font-family: 'Proxima Nova Regular', 'Helvetica Neue', Arial, Helvetica, sans-serif !important;
            font-size: 16px !important;

            a.gs-title {
                color: $main-link-color !important;
                text-decoration: none !important;
            }

            .gs-visibleUrl {
                color: $main-text-color !important;
                font-style: italic;
            }

            .gsc-table-result {
                color: $main-text-color !important;
            }

            .gsc-results .gsc-cursor-box .gsc-cursor-page {
                color: $main-link-color !important;
            }

            .gsc-results .gsc-cursor-box .gsc-cursor-current-page {
                color: $main-link-color !important;
            }
        }
    }
}

/* Extra small: (phones, 480px and up) */
@media (min-width: 300px) {
    header {
        > nav {
            display: block;
            > ul {
                > li {
                    margin: auto 5px;
                }
            }
        }
    }


    .content-width {
        width: calc(100% - 60px);
    }

    nav.intro {
        ul {
            width: 100%;
            li {
                width: calc(25% - 4px);
            }
        }
    }

    .container {
        nav.usermanual {
            width: 180px;
        }

        nav.tutorial {
            width: 180px;
        }

        main {
            width: calc(100% - 210px);
            img {
                max-width: 100%;
            }
        }
    }

    pre.api {
        min-height: 2em;
        line-height: 2em;
        color: #fff;
        background: #1d292c;
        padding: 0.5em;
        font-size: 12px;
    }

    .params {
        margin: 1em 0;
        line-height: 2;
        border-left: 4px solid #1d292c;
        padding: 0 0.5em 0 1em;
        font-size: 14px;
        display: table;

        .parameter {
            display: table-row;
        }

        p {
            display: table-cell;
        }

        .param {
            display: table-cell;
            font-size: 16px;
            font-weight: bold;
            padding: 0.5em 1em 0.5em 0.5em;

            &:after {
                content: ':';
            }
        }
    }
}

/* Small devices (tablets, desktops, 768px and up) */
@media (min-width: 768px) {

    .content-width {
        width: calc(100% - 60px);
    }

    nav.intro {
        ul {
            width: 616px;
            li {
                width: 150px;

                &:last-child {
                    border-right: 1px solid $navbar-border-color;
                }

            }
        }
    }

    .container {
        nav.usermanual {
            width: 180px;
        }

        nav.tutorial {
            width: 180px;
        }

        main {
            width: calc(100% - 210px);
            img {
                max-width: 100%;
            }
        }
    }
}

/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
    header {
        > nav {
            > ul {
                > li {
                    margin: auto 30px;
                }
            }
        }
    }

    .content-width {
        width: calc(100% - 60px);
    }

    nav.intro {
        ul {
            width: 816px;
            li {
                width: 200px;

            }
        }
    }

    .container {
        nav.usermanual {
            width: 240px;
        }

        nav.tutorial {
            width: 240px;
        }

        main {
            width: calc(100% - 270px);
            img {
                max-width: 100%;
            }
        }
    }
}

/* Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .content-width {
        width: 1070px;
    }

    nav.intro {
        ul {
            width: 816px;
            li {
                width: 200px;
            }
        }
    }

    .container {
        nav.usermanual {
            width: 240px;
        }

        main {
            width: 800px;
            img {
                max-width: 800px;
            }

            .full-width {
                width: 970px;
            }
        }
    }
}
